// eslint-disable-next-line no-undef
let isProduction = process.env.NODE_ENV === 'production'
const { hostname, protocol, port } = window.location
const baseUrl = `${protocol}//${hostname}:5001` //'http://49.234.30.189:9007'
const baseApi = isProduction
    ? `${baseUrl}/gateway_api`
    : 'http://127.0.0.1:5001/gateway_api' //生产环境使用
const socketUrl = isProduction ? `ws://${hostname}:9016` : 'ws://127.0.0.1:9016'
const imgUrl = isProduction ? `${protocol}//${hostname}:${port}` : 'http://248'
let IPUrl
if (port !== '') {
    IPUrl = isProduction ? `${hostname}:${port}` : '127.0.0.1'
} else {
    IPUrl = isProduction ? `${hostname}` : '127.0.0.1'
}

export default {
    baseUrl,
    baseApi,
    uploadUrl: baseApi + '/upload/upload',
    socketUrl,
    imgUrl,
    IPUrl,
    // baseApi: baseUrl,
}
